package bislider;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Vector;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;

import com.visutools.nav.bislider.*;

public class Main {
	
	public static void main(String[] Args) {
		final JFrame JFrame1 = new JFrame("Test Bislider");
		
	    JFrame1.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
	    JFrame1.addWindowListener(new WindowAdapter() {
	      @Override 
	      public void windowClosing(WindowEvent evt) {
	        JFrame1.setVisible(false);
	        JFrame1.dispose();
	        System.exit(0);
	      }
	    });
	    
	    // tableau de valeurs, chaque indice représente une hauteur de la colonne
	    final Vector<Integer> SliderInfos = new Vector<Integer>();
	    SliderInfos.add(0, 3); // colonne 0 : contient 3 unités (titre, album, ...)
	    SliderInfos.add(1, 3);
	    SliderInfos.add(2, 8);
	    SliderInfos.add(3, 8);
	    SliderInfos.add(4, 8);
	    SliderInfos.add(5, 8);
	    SliderInfos.add(6, 15);
	    SliderInfos.add(7, 15);
	    SliderInfos.add(8, 11);
	    SliderInfos.add(9, 11);
	    
	    MyBiSlider BiSlider = new MyBiSlider(SliderInfos);
	    
	    JFrame1.getContentPane().setLayout(new BorderLayout(2, 2));
	    JFrame1.getContentPane().add(BorderLayout.CENTER, BiSlider);
	    
	    JFrame1.setSize(new Dimension(500, 100));
	    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
	    JFrame1.setLocation((screenSize.width-JFrame1.getWidth())/2,(screenSize.height-JFrame1.getHeight())/2);
	    JFrame1.setVisible(true);
	}
	
}
